Component({
	data: {
		safeArea: 0,
		selected: 0,
		color: '#7A7E83',
		selectedColor: 'rgba(255, 0, 0, 1)',
		list: [{
				pagePath: '/pages/index/index',
				iconPath: '/static/img/home.png',
				selectedIconPath: '/static/img/home_s.png',
				text: '首页',
			},
			{
				pagePath: '/pages/ready/ready',
				iconPath: '/static/img/ready.png',
				selectedIconPath: '/static/img/ready.png',
				text: '预登记',
			},
			{
				pagePath: '/pages/my/my',
				iconPath: '/static/img/my.png',
				selectedIconPath: '/static/img/my_s.png',
				text: '我的',
			},
		],
		ciffpic:false,
	},
	attached() {
		this.setData({
			safeArea: wx.getStorageSync('safeArea') || 0,
		})
		// wx.hideTabBar({
		// 	animation: false
		// })
	},
	methods: {
		switchTab(e) {
			const data = e.currentTarget.dataset
			const url = data.path

			if(url=='/pages/ready/ready'){
				this.setData({
					ciffpic:true
				})

				setTimeout(()=>{
					this.setData({
						ciffpic:false
					})
					wx.navigateToMiniProgram({
						appId:"wxa5b332c7ac698196",
						path:"",
						success:(res)=> {
							// 打开成功
							console.log(res)
						},
						fail:(res)=>{
							//用户点取消则失败
						}
					})
				},2000)
				console.log(url)
				
				return
			}
			wx.switchTab({
				url
			})
			this.setData({
				selected: data.index,
			})
		},
	},
})
